import request from "@/utils/request"


export function submitCourseBaseMessage(baseMessage) {

  return request({

    url: '/admin/education/course/add-base-message',
    method: 'post',
    data: baseMessage
  })

}

export function findCourseBaseMessage(courseId) {

  return request({

    url: '/admin/education/course/' + courseId,
    method: 'get'
  })
}

export function updateCourseBaseMessage(baseMessage) {

  return request({

    url: '/admin/education/course/update-base-message',
    method: 'put',
    data: baseMessage
  })
}

export function findCourseList(page, size, params) {

  return request({

    url: `/admin/education/course/list/${page}/${size}`,
    method: 'get',
    params
  })
}


export function deleteCourseById(courseId) {

  return request({

    url: `/admin/education/course/delete/${courseId}`,
    method: 'delete',
  })
}

// 获取待发布课程信息
export function findCourseDraft(courseId) {

  return request({
    url: `/admin/education/course/draft/${courseId}`,
    method: 'get'
  })
}


export function publishCourse(courseId) {

  return request({

    url: `/admin/education/course/publish/${courseId}`,
    method:'put'
  })
}
